#include "widget.h"
#include "ui_widget.h"

#include <QPushButton>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    QPushButton* button = new QPushButton(this);

    button->setText("按钮");

    button->move(300, 200);

    connect(button, &QPushButton::clicked, this, &Widget::handleClicked);


}

Widget::~Widget()
{
    delete ui;
}

void Widget::handleClicked()
{
    // 按下按钮，修改窗口的标题
    this->setWindowTitle("窗口的标题被修改了");
}

